/**
 * @file   DataBusClientListModel.h
 * @author Djuro Drljaca (djurodrljaca@gmail.com)
 * @date   2013-05-04
 * @brief  DataBus Client List Model.
 *
 * Copyright (C) 2013  Djuro Drljaca <djurodrljaca@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef DATABUSCLIENTLISTMMODEL_H
#define DATABUSCLIENTLISTMMODEL_H

#include <QtCore/QObject>
#include <QtCore/QAbstractListModel>
#include <QtCore/QVariant>
#include <QtCore/QList>

class DataBusServer;

class DataBusClientListModel : public QAbstractListModel
{
    Q_OBJECT

public:
    DataBusClientListModel(QObject *parent = 0);

    int rowCount(const QModelIndex &parent = QModelIndex()) const;
    QVariant data(const QModelIndex &index, int role) const;
    QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
    void removeAllClients();
    bool removeClient(quint8 clientId);
    void addClient(quint8 clientId);

private:
    QList<quint8> m_clientIdList;
};

#endif // DATABUSCLIENTLISTMMODEL_H
